package Test;
import java.util.Scanner;

abstract class A {
     int x1;
     int x2;
    abstract public int sum();

    public A(int x1, int x2) {
        this.x1 = x1;
        this.x2 = x2;
    }
}
class B extends A {


    public B(int x1, int x2) {
        super(x1, x2);
    }

    @Override
    public int sum() {
        return x1*10+x2;
    }
}


interface Comparator {
    int  max();
}
class ComparatorImpl implements Comparator {

   private int x;
    private int y;

    public ComparatorImpl(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public int max() {
    return x>y?x:y;
    }
}
public class Test1 {
    public static void main(String[] args) {
        //消失的数字
        int []array={1,2,3,4,5,7,8,9,10};

    }
    public static void main6(String[] args) {
        String string = "H e l l o ! n o w c o d e r";
        Scanner scanner= new Scanner(System.in);
        String word = scanner.next();
        scanner.close();
        System.out.println(check(string, word));
    }

    public static int check(String str, String word) {

        // 使用字符数组外加foreach遍历一遍后得到结果
        //write your code here......
        int counts = 0;
        for (int i = 0; i <str.length() ; i++) {
            if (word.charAt(0) == str.charAt(i)) {
                counts++;
            }
        }
        return counts;

    }
    public static void main5(String[] args) {
        String p="woaini";
        StringBuilder p1=new StringBuilder(p);
        p1.insert(3,',');
        System.out.println(p1);
    }
    public static void main4(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();

        //新建可变字符串sb
        StringBuilder sb=new StringBuilder();
        //将str添加到sb
        sb.append(str);
        int n=str.length();
        //循环
        for(int i=n-3;i>0;i-=3){
            //从后往前每隔三个字符插入一个逗号
            sb.insert(i,",");
        }
        System.out.println(sb.toString());
    }
    public static void main3(String[] args) {
        //将一个由英文字母组成的字符串转换成从末尾开始每三个字母用逗号分隔的形式。
        Scanner scanner=new Scanner(System.in);
        String p=scanner.next();
        int count=0;
        StringBuilder p1=new StringBuilder();
        for (int i = p.length()-1; i >=0 ; i--) {
            count++;
            p1.append(p.charAt(i));
            if (i!=0)
            if (count==3) {
                p1.append(',');
                count=0;
            }
        }
        System.out.println(p1.reverse());
    }
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        A a=new B(scanner.nextInt(),scanner.nextInt());
        System.out.println(a.sum());
    }
    public static void main1(String[] args) {
        //Comparator
        Scanner scanner=new Scanner(System.in);
        Comparator comparator=new ComparatorImpl(scanner.nextInt(),scanner.nextInt());
        System.out.println(comparator.max());
    }
}
